package org.xiji.Flyweight;

/**
 * 享元模式测试类
 */
public class FlyweightMain {
    public static void main(String[] args) {
        String zhangSan = "张三";
        String xiaoJiu = "小久";
        String xiJi = "惜己";
        String liSi = "李四";

        //获取卫生纸
        PaperManger paperManger = new PaperManger();
        Paper toiletPaper = paperManger.getInstance("卫生纸");
        //获取湿巾
        Paper wipesPaper = paperManger.getInstance("湿巾");

        //使用
        toiletPaper.use(zhangSan);
        wipesPaper.use(xiaoJiu);
        toiletPaper.use(xiJi);
        wipesPaper.use(liSi);




    }
}
